<?php
session_start();
include 'includes/constants.php';
if (isset($_POST['enviar'])) {
// <editor-fold defaultstate="collapsed" desc="Email">
    $to = 'ccivenezuela@gmail.com';
    $subject = 'Contacto CCI Venezuela';
    $message = "<h1>Contacto CCI Venezuela</h1>";
    $message.="<h2>Nombre</h2><p>" . $_POST['nombre'] . "</p>";
    $message.="<h2>Tel&eacute;fono</h2><p>" . $_POST['telefono'] . "</p>";
    $message.="<h2>Email</h2><p>" . $_POST['email'] . "</p>";
    $message.="<h2>Comentario</h2><p>" . $_POST['comentario'] . "</p>";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: CCI Venezuela Daemon <info@ccivenezuela.com>' . "\r\n";
    // </editor-fold>
    $exito = mail($to, $subject, $message, $headers);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="css/style.css" media="all" rel="stylesheet" type="text/css"/>
        <title>CCI Venezuela :: Contacto</title>
        <script type="text/javascript" language="javascript" src="js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" language="javascript" src="js/index.js" ></script>
        <script type="text/javascript" language="javascript" src="js/jquery-validate/jquery.validate.pack.js"></script>
        <script type="text/javascript" src="js/jquery-validate/localization/messages_es.js"></script>
        <script type="text/javascript" language="javascript">
            $(document).ready(function(){
                $("#content form").validate();
            });
        </script>
        <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-571063-15']);
            _gaq.push(['_trackPageview']);
            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
        </script>
    </head>
    <body>
        <div id="header">
            <?php include 'template/header.php'; ?>
        </div>
        <div id="content">
            <div id="banner">
                <?php include_once 'template/ad_banner.php'; ?>
            </div>
            <div class="contenido">
                <h1>Contacto</h1>
                <?php include_once 'template/ad_lateral.php'; ?>
                <div>
                    <dl>
                        <dt>
                        <img src="<?php echo ROOT.IMAGES ?>users.png" height="16" align="absmiddle"/>
                        <span>Miguel Delgado &rarr; T&eacute;lf. 0414–681.50.08</span>
                        </dt>
                        <dd><b>Gerente de Relaciones</b.</dd>
                    </dl>
                </div>
                <div style="width: 700px;">
                    <?php if (!isset($exito) || $exito != true): ?>
                        <form method="post" action="contacto.php">
                            <fieldset>
                                <legend>Datos Personales</legend>
                                <div>
                                    <label for="nombre">Nombre<sup>*</sup></label>
                                    <input type="text" name="nombre" class="required"/>
                                </div>
                                <div>
                                    <label for="telefono">Tel&eacute;fono</label>
                                    <input type="text" name="telefono"/>
                                </div>
                                <div>
                                    <label for="email">Email<sup>*</sup></label>
                                    <input type="text" name="email" class="required"/>
                                </div>
                            </fieldset>
                            <fieldset>
                                <legend>Comentario</legend>
                                <div>
                                    <label for="comentario">Comentario<sup>*</sup></label>
                                    <textarea name="comentario" class="required" cols="65" rows="3"></textarea>
                                </div>
                            </fieldset>
                            <fieldset>
                                <legend>Acci&oacute;n</legend>
                                <div style="text-align: center;">
                                    <input type="submit" name="enviar" value="Enviar"/>
                                </div>
                            </fieldset>
                        </form>
                    <?php else: ?>
                        <div class="info">
                            <p>Formulario enviado. Nos comunicaremos brevemente con usted.</p>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div id="footer">
            <?php include 'template/footer.php'; ?>
        </div>
    </body>
</html>
